﻿using Caffeine.Core.Metadata;
using Caffeine.Core.Test.TestModel;
using System;
using System.Linq;

namespace Caffeine.Core.Test.TestModel
{
    public class ModelForMetadataTesting : ModelBase
    {
        #region State

        private readonly ModelProperty<String> _fullNameProperty;
        private readonly ModelProperty<Person> _personProperty;

        #endregion

        #region Constructors

        public ModelForMetadataTesting()
        {
            _fullNameProperty = RegisterComputedProperty<String>
            (
                "FullNameProperty", 
                (properties, lastValue) => 
                { 
                    return (!String.IsNullOrEmpty(lastValue)) ? String.Format("{0}, {1}", properties.First().Value, properties.Last().Value) : null; 
                },
                FirstNameProperty, 
                LastNameProperty
            );
            
            _personProperty = RegisterComputedProperty<Person, String>
            (
                "PersonProperty", 
                (properties, lastValue) => 
                {
                    String firstName = properties.First().Value;
                    String lastName = properties.Last().Value;

                    if (!String.IsNullOrEmpty(firstName) || !String.IsNullOrEmpty(lastName))
                    {
                        return new Person()
                        {
                            FirstName = properties.First().Value,
                            LastName = properties.Last().Value
                        };
                    }
                    else
                    {
                        return null;
                    }
                },
                PersonFirstNameProperty,
                PersonLastNameProperty
            );
        }

        public ModelForMetadataTesting(Object parameter)
        {
            //Non-default constructor
        }

        #endregion

        #region Public

        #region Properties

        public ModelProperty<String> FullNameProperty
        {
            get
            {
                return _fullNameProperty;
            }
        }

        public ModelProperty<Person> PersonProperty
        {
            get
            {
                return _personProperty;
            }
        }

        #region EquatableTestStruct Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(EquatableTestStruct), "EquatableTestStructProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<EquatableTestStruct> _EquatableTestStructProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the EquatableTestStruct backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<EquatableTestStruct> EquatableTestStructProperty
        {
            get { return _EquatableTestStructProperty; }
        }

        /// <summary>
        /// Gets or sets the EquatableTestStructProperty.Value value. This property supports change notification. If the EquatableTestStructProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [EquatableTestStructProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public EquatableTestStruct EquatableTestStruct
        {
            get { return EquatableTestStructProperty.Value; }
            set { EquatableTestStructProperty.Value = value; }
        }

        /// <summary>
        /// Gets the EquatableTestStructProperty.CommittedValue value. This property supports change notification. If the EquatableTestStructProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [EquatableTestStruct + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public EquatableTestStruct EquatableTestStructCommittedValue
        {
            get { return EquatableTestStructProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the EquatableTestStructProperty.IsDirty flag. This property supports change notification. If the EquatableTestStructProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [EquatableTestStruct + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool EquatableTestStructIsDirty
        {
            get { return EquatableTestStructProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the EquatableTestStructProperty.IsInvalid flag. This property supports change notification. If the EquatableTestStructProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [EquatableTestStruct + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool EquatableTestStructIsInvalid
        {
            get { return EquatableTestStructProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the EquatableTestStructProperty.IsDefault flag. This property supports change notification. If the EquatableTestStructProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [EquatableTestStruct + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool EquatableTestStructIsDefault
        {
            get { return EquatableTestStructProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the EquatableTestStructProperty.ValidationErrors enumeration. This property supports change notification. If the EquatableTestStructProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [EquatableTestStruct + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> EquatableTestStructValidationErrors
        {
            get { return EquatableTestStructProperty.ValidationErrors; }
        }

        #endregion

        #region NullableEquatableTestStruct Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<EquatableTestStruct>), "NullableEquatableTestStructProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<EquatableTestStruct>> _NullableEquatableTestStructProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableEquatableTestStruct backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<Nullable<EquatableTestStruct>> NullableEquatableTestStructProperty
        {
            get { return _NullableEquatableTestStructProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableEquatableTestStructProperty.Value value. This property supports change notification. If the NullableEquatableTestStructProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEquatableTestStructProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<EquatableTestStruct> NullableEquatableTestStruct
        {
            get { return NullableEquatableTestStructProperty.Value; }
            set { NullableEquatableTestStructProperty.Value = value; }
        }

        /// <summary>
        /// Gets the NullableEquatableTestStructProperty.CommittedValue value. This property supports change notification. If the NullableEquatableTestStructProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEquatableTestStruct + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<EquatableTestStruct> NullableEquatableTestStructCommittedValue
        {
            get { return NullableEquatableTestStructProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the NullableEquatableTestStructProperty.IsDirty flag. This property supports change notification. If the NullableEquatableTestStructProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEquatableTestStruct + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableEquatableTestStructIsDirty
        {
            get { return NullableEquatableTestStructProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the NullableEquatableTestStructProperty.IsInvalid flag. This property supports change notification. If the NullableEquatableTestStructProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEquatableTestStruct + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableEquatableTestStructIsInvalid
        {
            get { return NullableEquatableTestStructProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the NullableEquatableTestStructProperty.IsDefault flag. This property supports change notification. If the NullableEquatableTestStructProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEquatableTestStruct + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableEquatableTestStructIsDefault
        {
            get { return NullableEquatableTestStructProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the NullableEquatableTestStructProperty.ValidationErrors enumeration. This property supports change notification. If the NullableEquatableTestStructProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEquatableTestStruct + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> NullableEquatableTestStructValidationErrors
        {
            get { return NullableEquatableTestStructProperty.ValidationErrors; }
        }

        #endregion

        #region TestStruct Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(TestStruct), "TestStructProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<TestStruct> _TestStructProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the TestStruct backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<TestStruct> TestStructProperty
        {
            get { return _TestStructProperty; }
        }

        /// <summary>
        /// Gets or sets the TestStructProperty.Value value. This property supports change notification. If the TestStructProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [TestStructProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public TestStruct TestStruct
        {
            get { return TestStructProperty.Value; }
            set { TestStructProperty.Value = value; }
        }

        /// <summary>
        /// Gets the TestStructProperty.CommittedValue value. This property supports change notification. If the TestStructProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [TestStruct + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public TestStruct TestStructCommittedValue
        {
            get { return TestStructProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the TestStructProperty.IsDirty flag. This property supports change notification. If the TestStructProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [TestStruct + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool TestStructIsDirty
        {
            get { return TestStructProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the TestStructProperty.IsInvalid flag. This property supports change notification. If the TestStructProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [TestStruct + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool TestStructIsInvalid
        {
            get { return TestStructProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the TestStructProperty.IsDefault flag. This property supports change notification. If the TestStructProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [TestStruct + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool TestStructIsDefault
        {
            get { return TestStructProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the TestStructProperty.ValidationErrors enumeration. This property supports change notification. If the TestStructProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [TestStruct + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> TestStructValidationErrors
        {
            get { return TestStructProperty.ValidationErrors; }
        }

        #endregion

        #region NullableTestStruct Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<TestStruct>), "NullableTestStructProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<TestStruct>> _NullableTestStructProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableTestStruct backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<Nullable<TestStruct>> NullableTestStructProperty
        {
            get { return _NullableTestStructProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableTestStructProperty.Value value. This property supports change notification. If the NullableTestStructProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableTestStructProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<TestStruct> NullableTestStruct
        {
            get { return NullableTestStructProperty.Value; }
            set { NullableTestStructProperty.Value = value; }
        }

        /// <summary>
        /// Gets the NullableTestStructProperty.CommittedValue value. This property supports change notification. If the NullableTestStructProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableTestStruct + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<TestStruct> NullableTestStructCommittedValue
        {
            get { return NullableTestStructProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the NullableTestStructProperty.IsDirty flag. This property supports change notification. If the NullableTestStructProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableTestStruct + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableTestStructIsDirty
        {
            get { return NullableTestStructProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the NullableTestStructProperty.IsInvalid flag. This property supports change notification. If the NullableTestStructProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableTestStruct + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableTestStructIsInvalid
        {
            get { return NullableTestStructProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the NullableTestStructProperty.IsDefault flag. This property supports change notification. If the NullableTestStructProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableTestStruct + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableTestStructIsDefault
        {
            get { return NullableTestStructProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the NullableTestStructProperty.ValidationErrors enumeration. This property supports change notification. If the NullableTestStructProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableTestStruct + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> NullableTestStructValidationErrors
        {
            get { return NullableTestStructProperty.ValidationErrors; }
        }

        #endregion

        #region EnumValue Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(EnumForTesting), "EnumValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<EnumForTesting> _EnumValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the EnumValue backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<EnumForTesting> EnumValueProperty
        {
            get { return _EnumValueProperty; }
        }

        /// <summary>
        /// Gets or sets the EnumValueProperty.Value value. This property supports change notification. If the EnumValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [EnumValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public EnumForTesting EnumValue
        {
            get { return EnumValueProperty.Value; }
            set { EnumValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the EnumValueProperty.CommittedValue value. This property supports change notification. If the EnumValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [EnumValue + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public EnumForTesting EnumValueCommittedValue
        {
            get { return EnumValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the EnumValueProperty.IsDirty flag. This property supports change notification. If the EnumValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [EnumValue + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool EnumValueIsDirty
        {
            get { return EnumValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the EnumValueProperty.IsInvalid flag. This property supports change notification. If the EnumValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [EnumValue + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool EnumValueIsInvalid
        {
            get { return EnumValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the EnumValueProperty.IsDefault flag. This property supports change notification. If the EnumValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [EnumValue + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool EnumValueIsDefault
        {
            get { return EnumValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the EnumValueProperty.ValidationErrors enumeration. This property supports change notification. If the EnumValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [EnumValue + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> EnumValueValidationErrors
        {
            get { return EnumValueProperty.ValidationErrors; }
        }

        #endregion

        #region NullableEnumValue Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<EnumForTesting>), "NullableEnumValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<EnumForTesting>> _NullableEnumValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableEnumValue backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<Nullable<EnumForTesting>> NullableEnumValueProperty
        {
            get { return _NullableEnumValueProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableEnumValueProperty.Value value. This property supports change notification. If the NullableEnumValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEnumValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<EnumForTesting> NullableEnumValue
        {
            get { return NullableEnumValueProperty.Value; }
            set { NullableEnumValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the NullableEnumValueProperty.CommittedValue value. This property supports change notification. If the NullableEnumValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEnumValue + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<EnumForTesting> NullableEnumValueCommittedValue
        {
            get { return NullableEnumValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the NullableEnumValueProperty.IsDirty flag. This property supports change notification. If the NullableEnumValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEnumValue + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableEnumValueIsDirty
        {
            get { return NullableEnumValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the NullableEnumValueProperty.IsInvalid flag. This property supports change notification. If the NullableEnumValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEnumValue + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableEnumValueIsInvalid
        {
            get { return NullableEnumValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the NullableEnumValueProperty.IsDefault flag. This property supports change notification. If the NullableEnumValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEnumValue + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableEnumValueIsDefault
        {
            get { return NullableEnumValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the NullableEnumValueProperty.ValidationErrors enumeration. This property supports change notification. If the NullableEnumValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableEnumValue + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> NullableEnumValueValidationErrors
        {
            get { return NullableEnumValueProperty.ValidationErrors; }
        }

        #endregion

        #region CharValue Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Char), "CharValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Char> _CharValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the CharValue backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<Char> CharValueProperty
        {
            get { return _CharValueProperty; }
        }

        /// <summary>
        /// Gets or sets the CharValueProperty.Value value. This property supports change notification. If the CharValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [CharValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Char CharValue
        {
            get { return CharValueProperty.Value; }
            set { CharValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the CharValueProperty.CommittedValue value. This property supports change notification. If the CharValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [CharValue + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Char CharValueCommittedValue
        {
            get { return CharValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the CharValueProperty.IsDirty flag. This property supports change notification. If the CharValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [CharValue + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool CharValueIsDirty
        {
            get { return CharValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the CharValueProperty.IsInvalid flag. This property supports change notification. If the CharValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [CharValue + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool CharValueIsInvalid
        {
            get { return CharValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the CharValueProperty.IsDefault flag. This property supports change notification. If the CharValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [CharValue + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool CharValueIsDefault
        {
            get { return CharValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the CharValueProperty.ValidationErrors enumeration. This property supports change notification. If the CharValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [CharValue + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> CharValueValidationErrors
        {
            get { return CharValueProperty.ValidationErrors; }
        }

        #endregion

        #region NullableCharValue Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Nullable<Char>), "NullableCharValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Nullable<Char>> _NullableCharValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the NullableCharValue backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<Nullable<Char>> NullableCharValueProperty
        {
            get { return _NullableCharValueProperty; }
        }

        /// <summary>
        /// Gets or sets the NullableCharValueProperty.Value value. This property supports change notification. If the NullableCharValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableCharValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<Char> NullableCharValue
        {
            get { return NullableCharValueProperty.Value; }
            set { NullableCharValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the NullableCharValueProperty.CommittedValue value. This property supports change notification. If the NullableCharValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableCharValue + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Nullable<Char> NullableCharValueCommittedValue
        {
            get { return NullableCharValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the NullableCharValueProperty.IsDirty flag. This property supports change notification. If the NullableCharValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableCharValue + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableCharValueIsDirty
        {
            get { return NullableCharValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the NullableCharValueProperty.IsInvalid flag. This property supports change notification. If the NullableCharValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableCharValue + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableCharValueIsInvalid
        {
            get { return NullableCharValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the NullableCharValueProperty.IsDefault flag. This property supports change notification. If the NullableCharValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableCharValue + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool NullableCharValueIsDefault
        {
            get { return NullableCharValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the NullableCharValueProperty.ValidationErrors enumeration. This property supports change notification. If the NullableCharValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [NullableCharValue + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> NullableCharValueValidationErrors
        {
            get { return NullableCharValueProperty.ValidationErrors; }
        }

        #endregion

        #region StringValue Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(String), "StringValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<String> _StringValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the StringValue backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<String> StringValueProperty
        {
            get { return _StringValueProperty; }
        }

        /// <summary>
        /// Gets or sets the StringValueProperty.Value value. This property supports change notification. If the StringValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [StringValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String StringValue
        {
            get { return StringValueProperty.Value; }
            set { StringValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the StringValueProperty.CommittedValue value. This property supports change notification. If the StringValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [StringValue + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String StringValueCommittedValue
        {
            get { return StringValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the StringValueProperty.IsDirty flag. This property supports change notification. If the StringValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [StringValue + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool StringValueIsDirty
        {
            get { return StringValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the StringValueProperty.IsInvalid flag. This property supports change notification. If the StringValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [StringValue + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool StringValueIsInvalid
        {
            get { return StringValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the StringValueProperty.IsDefault flag. This property supports change notification. If the StringValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [StringValue + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool StringValueIsDefault
        {
            get { return StringValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the StringValueProperty.ValidationErrors enumeration. This property supports change notification. If the StringValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [StringValue + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> StringValueValidationErrors
        {
            get { return StringValueProperty.ValidationErrors; }
        }

        #endregion

        #region FirstName Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(String), "FirstNameProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<String> _FirstNameProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the FirstName backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<String> FirstNameProperty
        {
            get { return _FirstNameProperty; }
        }

        /// <summary>
        /// Gets or sets the FirstNameProperty.Value value. This property supports change notification. If the FirstNameProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [FirstNameProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String FirstName
        {
            get { return FirstNameProperty.Value; }
            set { FirstNameProperty.Value = value; }
        }

        /// <summary>
        /// Gets the FirstNameProperty.CommittedValue value. This property supports change notification. If the FirstNameProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [FirstName + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String FirstNameCommittedValue
        {
            get { return FirstNameProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the FirstNameProperty.IsDirty flag. This property supports change notification. If the FirstNameProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [FirstName + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool FirstNameIsDirty
        {
            get { return FirstNameProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the FirstNameProperty.IsInvalid flag. This property supports change notification. If the FirstNameProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [FirstName + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool FirstNameIsInvalid
        {
            get { return FirstNameProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the FirstNameProperty.IsDefault flag. This property supports change notification. If the FirstNameProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [FirstName + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool FirstNameIsDefault
        {
            get { return FirstNameProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the FirstNameProperty.ValidationErrors enumeration. This property supports change notification. If the FirstNameProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [FirstName + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> FirstNameValidationErrors
        {
            get { return FirstNameProperty.ValidationErrors; }
        }

        #endregion

        #region LastName Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(String), "LastNameProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<String> _LastNameProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the LastName backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<String> LastNameProperty
        {
            get { return _LastNameProperty; }
        }

        /// <summary>
        /// Gets or sets the LastNameProperty.Value value. This property supports change notification. If the LastNameProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [LastNameProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String LastName
        {
            get { return LastNameProperty.Value; }
            set { LastNameProperty.Value = value; }
        }

        /// <summary>
        /// Gets the LastNameProperty.CommittedValue value. This property supports change notification. If the LastNameProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [LastName + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String LastNameCommittedValue
        {
            get { return LastNameProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the LastNameProperty.IsDirty flag. This property supports change notification. If the LastNameProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [LastName + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool LastNameIsDirty
        {
            get { return LastNameProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the LastNameProperty.IsInvalid flag. This property supports change notification. If the LastNameProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [LastName + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool LastNameIsInvalid
        {
            get { return LastNameProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the LastNameProperty.IsDefault flag. This property supports change notification. If the LastNameProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [LastName + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool LastNameIsDefault
        {
            get { return LastNameProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the LastNameProperty.ValidationErrors enumeration. This property supports change notification. If the LastNameProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [LastName + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> LastNameValidationErrors
        {
            get { return LastNameProperty.ValidationErrors; }
        }

        #endregion

        #region PersonFirstName Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(String), "PersonFirstNameProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<String> _PersonFirstNameProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the PersonFirstName backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<String> PersonFirstNameProperty
        {
            get { return _PersonFirstNameProperty; }
        }

        /// <summary>
        /// Gets or sets the PersonFirstNameProperty.Value value. This property supports change notification. If the PersonFirstNameProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonFirstNameProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String PersonFirstName
        {
            get { return PersonFirstNameProperty.Value; }
            set { PersonFirstNameProperty.Value = value; }
        }

        /// <summary>
        /// Gets the PersonFirstNameProperty.CommittedValue value. This property supports change notification. If the PersonFirstNameProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonFirstName + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String PersonFirstNameCommittedValue
        {
            get { return PersonFirstNameProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the PersonFirstNameProperty.IsDirty flag. This property supports change notification. If the PersonFirstNameProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonFirstName + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool PersonFirstNameIsDirty
        {
            get { return PersonFirstNameProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the PersonFirstNameProperty.IsInvalid flag. This property supports change notification. If the PersonFirstNameProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonFirstName + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool PersonFirstNameIsInvalid
        {
            get { return PersonFirstNameProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the PersonFirstNameProperty.IsDefault flag. This property supports change notification. If the PersonFirstNameProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonFirstName + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool PersonFirstNameIsDefault
        {
            get { return PersonFirstNameProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the PersonFirstNameProperty.ValidationErrors enumeration. This property supports change notification. If the PersonFirstNameProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonFirstName + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> PersonFirstNameValidationErrors
        {
            get { return PersonFirstNameProperty.ValidationErrors; }
        }

        #endregion

        #region PersonLastName Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(String), "PersonLastNameProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<String> _PersonLastNameProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the PersonLastName backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<String> PersonLastNameProperty
        {
            get { return _PersonLastNameProperty; }
        }

        /// <summary>
        /// Gets or sets the PersonLastNameProperty.Value value. This property supports change notification. If the PersonLastNameProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonLastNameProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String PersonLastName
        {
            get { return PersonLastNameProperty.Value; }
            set { PersonLastNameProperty.Value = value; }
        }

        /// <summary>
        /// Gets the PersonLastNameProperty.CommittedValue value. This property supports change notification. If the PersonLastNameProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonLastName + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public String PersonLastNameCommittedValue
        {
            get { return PersonLastNameProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the PersonLastNameProperty.IsDirty flag. This property supports change notification. If the PersonLastNameProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonLastName + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool PersonLastNameIsDirty
        {
            get { return PersonLastNameProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the PersonLastNameProperty.IsInvalid flag. This property supports change notification. If the PersonLastNameProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonLastName + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool PersonLastNameIsInvalid
        {
            get { return PersonLastNameProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the PersonLastNameProperty.IsDefault flag. This property supports change notification. If the PersonLastNameProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonLastName + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool PersonLastNameIsDefault
        {
            get { return PersonLastNameProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the PersonLastNameProperty.ValidationErrors enumeration. This property supports change notification. If the PersonLastNameProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [PersonLastName + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> PersonLastNameValidationErrors
        {
            get { return PersonLastNameProperty.ValidationErrors; }
        }

        #endregion

        #region ObjectValue Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(Object), "ObjectValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<Object> _ObjectValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ObjectValue backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<Object> ObjectValueProperty
        {
            get { return _ObjectValueProperty; }
        }

        /// <summary>
        /// Gets or sets the ObjectValueProperty.Value value. This property supports change notification. If the ObjectValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [ObjectValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Object ObjectValue
        {
            get { return ObjectValueProperty.Value; }
            set { ObjectValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the ObjectValueProperty.CommittedValue value. This property supports change notification. If the ObjectValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [ObjectValue + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Object ObjectValueCommittedValue
        {
            get { return ObjectValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the ObjectValueProperty.IsDirty flag. This property supports change notification. If the ObjectValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [ObjectValue + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool ObjectValueIsDirty
        {
            get { return ObjectValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the ObjectValueProperty.IsInvalid flag. This property supports change notification. If the ObjectValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [ObjectValue + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool ObjectValueIsInvalid
        {
            get { return ObjectValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the ObjectValueProperty.IsDefault flag. This property supports change notification. If the ObjectValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [ObjectValue + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool ObjectValueIsDefault
        {
            get { return ObjectValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the ObjectValueProperty.ValidationErrors enumeration. This property supports change notification. If the ObjectValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [ObjectValue + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> ObjectValueValidationErrors
        {
            get { return ObjectValueProperty.ValidationErrors; }
        }

        #endregion

        #region ChildValue Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelForMetadataTesting), "ChildValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<ModelForMetadataTesting> _ChildValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ChildValue backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<ModelForMetadataTesting> ChildValueProperty
        {
            get { return _ChildValueProperty; }
        }

        /// <summary>
        /// Gets or sets the ChildValueProperty.Value value. This property supports change notification. If the ChildValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [ChildValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public ModelForMetadataTesting ChildValue
        {
            get { return ChildValueProperty.Value; }
            set { ChildValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the ChildValueProperty.CommittedValue value. This property supports change notification. If the ChildValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [ChildValue + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public ModelForMetadataTesting ChildValueCommittedValue
        {
            get { return ChildValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the ChildValueProperty.IsDirty flag. This property supports change notification. If the ChildValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [ChildValue + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool ChildValueIsDirty
        {
            get { return ChildValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the ChildValueProperty.IsInvalid flag. This property supports change notification. If the ChildValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [ChildValue + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool ChildValueIsInvalid
        {
            get { return ChildValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the ChildValueProperty.IsDefault flag. This property supports change notification. If the ChildValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [ChildValue + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool ChildValueIsDefault
        {
            get { return ChildValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the ChildValueProperty.ValidationErrors enumeration. This property supports change notification. If the ChildValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [ChildValue + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> ChildValueValidationErrors
        {
            get { return ChildValueProperty.ValidationErrors; }
        }

        #endregion

        #region Child2Value Property

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelForMetadataTesting), "Child2ValueProperty", Caffeine.Core.ModelBase.StandardBehaviors, false, true)]
        protected readonly Caffeine.Core.ModelProperty<ModelForMetadataTesting> _Child2ValueProperty = null; //Will be set by reflection.

        /// <summary>
        /// Gets the Child2Value backing property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public Caffeine.Core.ModelProperty<ModelForMetadataTesting> Child2ValueProperty
        {
            get { return _Child2ValueProperty; }
        }

        /// <summary>
        /// Gets or sets the Child2ValueProperty.Value value. This property supports change notification. If the Child2ValueProperty.Value value changes,
        /// it will cause a change notification event for this property. This property must follow the [Child2ValueProperty - "Property"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public ModelForMetadataTesting Child2Value
        {
            get { return Child2ValueProperty.Value; }
            set { Child2ValueProperty.Value = value; }
        }

        /// <summary>
        /// Gets the Child2ValueProperty.CommittedValue value. This property supports change notification. If the Child2ValueProperty.CommittedValue value changes,
        /// it will cause a change notification event for this property. This property must follow the [Child2Value + "CommittedValue"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public ModelForMetadataTesting Child2ValueCommittedValue
        {
            get { return Child2ValueProperty.CommittedValue; }
        }

        /// <summary>
        /// Gets the Child2ValueProperty.IsDirty flag. This property supports change notification. If the Child2ValueProperty.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [Child2Value + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool Child2ValueIsDirty
        {
            get { return Child2ValueProperty.IsDirty; }
        }

        /// <summary>
        /// Gets the Child2ValueProperty.IsInvalid flag. This property supports change notification. If the Child2ValueProperty.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [Child2Value + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool Child2ValueIsInvalid
        {
            get { return Child2ValueProperty.IsInvalid; }
        }

        /// <summary>
        /// Gets the Child2ValueProperty.IsDefault flag. This property supports change notification. If the Child2ValueProperty.IsDefault flag changes,
        /// it will cause a change notification event for this property. This property must follow the [Child2Value + "IsDefault"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public bool Child2ValueIsDefault
        {
            get { return Child2ValueProperty.IsDefault; }
        }

        /// <summary>
        /// Gets the Child2ValueProperty.ValidationErrors enumeration. This property supports change notification. If the Child2ValueProperty.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [Child2Value + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> Child2ValueValidationErrors
        {
            get { return Child2ValueProperty.ValidationErrors; }
        }

        #endregion

        #region Children Property

        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelForMetadataTesting), "Children", Caffeine.Core.ModelBase.StandardBehaviors, true, true)]
        protected readonly Caffeine.Core.ModelCollection<ModelForMetadataTesting> _Children = null; //Will be set by reflection.

        /// <summary>
        /// Gets the Children property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public Caffeine.Core.ModelCollection<ModelForMetadataTesting> Children
        {
            get { return _Children; }
        }

        /// <summary>
        /// Gets the Children.IsDirty flag. This property supports change notification. If the Children.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [Children + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public bool ChildrenIsDirty
        {
            get { return Children.IsDirty; }
        }

        /// <summary>
        /// Gets the Children.IsInvalid flag. This property supports change notification. If the Children.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [Children + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public bool ChildrenIsInvalid
        {
            get { return Children.IsInvalid; }
        }

        /// <summary>
        /// Gets the Children.ValidationErrors enumeration. This property supports change notification. If the Children.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [Children + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> ChildrenValidationErrors
        {
            get { return Children.ValidationErrors; }
        }

        #endregion

        #region Children2 Property

        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        [Caffeine.Core.ModelBackingProperty(typeof(ModelForMetadataTesting), "Children2", Caffeine.Core.ModelBase.StandardBehaviors, true, true)]
        protected readonly Caffeine.Core.ModelCollection<ModelForMetadataTesting> _Children2 = null; //Will be set by reflection.

        /// <summary>
        /// Gets the Children2 property
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public Caffeine.Core.ModelCollection<ModelForMetadataTesting> Children2
        {
            get { return _Children2; }
        }

        /// <summary>
        /// Gets the Children2.IsDirty flag. This property supports change notification. If the Children2.IsDirty flag changes,
        /// it will cause a change notification event for this property. This property must follow the [Children2 + "IsDirty"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public bool Children2IsDirty
        {
            get { return Children2.IsDirty; }
        }

        /// <summary>
        /// Gets the Children2.IsInvalid flag. This property supports change notification. If the Children2.IsInvalid flag changes,
        /// it will cause a change notification event for this property. This property must follow the [Children2 + "IsInvalid"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public bool Children2IsInvalid
        {
            get { return Children2.IsInvalid; }
        }

        /// <summary>
        /// Gets the Children2.ValidationErrors enumeration. This property supports change notification. If the Children2.ValidationErrors enumeration changes,
        /// it will cause a change notification event for this property. This property must follow the [Children2 + "ValidationErrors"] convention for change events to work correctly.
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCollection Property Snippet", "1.0")]
        public System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> Children2ValidationErrors
        {
            get { return Children2.ValidationErrors; }
        }

        #endregion

        #region ExecuteWithStringParam Command

        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        [Caffeine.Core.ModelCommandBackingProperty("OnExecuteWithStringParamExecute", "OnCanExecuteWithStringParamQuery", typeof(String))]
        protected readonly Caffeine.Core.ModelCommand<String> _ExecuteWithStringParamCommand = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ExecuteWithStringParamCommand
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        public Caffeine.Core.ModelCommand<String> ExecuteWithStringParamCommand
        {
            get { return _ExecuteWithStringParamCommand; }
        }

        /// <summary>
        /// Executes the ExecuteWithStringParamCommand 
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithStringParamCommand</param>
        /// <param name="parameter">Command parameter</param>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected void OnExecuteWithStringParamExecute(Caffeine.Core.ModelBase parent, String parameter)
        {
        }

        /// <summary>
        /// Queries whether or not the ExecuteWithStringParamCommand can execute
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithStringParamCommand</param>
        /// <param name="parameter">Parameter to consider</param>
        /// <returns>True if the ExecuteWithStringParamCommand can execute with the parameter specified, otherwise false.</returns>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected bool OnCanExecuteWithStringParamQuery(Caffeine.Core.ModelBase parent, String parameter)
        {
            return true;
        }

        #endregion

        #region ExecuteWithObjectParam Command

        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        [Caffeine.Core.ModelCommandBackingProperty("OnExecuteWithObjectParamExecute", "OnCanExecuteWithObjectParamQuery", typeof(Object))]
        protected readonly Caffeine.Core.ModelCommand<Object> _ExecuteWithObjectParamCommand = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ExecuteWithObjectParamCommand
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        public Caffeine.Core.ModelCommand<Object> ExecuteWithObjectParamCommand
        {
            get { return _ExecuteWithObjectParamCommand; }
        }

        /// <summary>
        /// Executes the ExecuteWithObjectParamCommand 
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithObjectParamCommand</param>
        /// <param name="parameter">Command parameter</param>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected void OnExecuteWithObjectParamExecute(Caffeine.Core.ModelBase parent, Object parameter)
        {
        }

        /// <summary>
        /// Queries whether or not the ExecuteWithObjectParamCommand can execute
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithObjectParamCommand</param>
        /// <param name="parameter">Parameter to consider</param>
        /// <returns>True if the ExecuteWithObjectParamCommand can execute with the parameter specified, otherwise false.</returns>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected bool OnCanExecuteWithObjectParamQuery(Caffeine.Core.ModelBase parent, Object parameter)
        {
            return true;
        }

        #endregion

        #region ExecuteWithCharParam Command

        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        [Caffeine.Core.ModelCommandBackingProperty("OnExecuteWithCharParamExecute", "OnCanExecuteWithCharParamQuery", typeof(Char))]
        protected readonly Caffeine.Core.ModelCommand<Char> _ExecuteWithCharParamCommand = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ExecuteWithCharParamCommand
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        public Caffeine.Core.ModelCommand<Char> ExecuteWithCharParamCommand
        {
            get { return _ExecuteWithCharParamCommand; }
        }

        /// <summary>
        /// Executes the ExecuteWithCharParamCommand 
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithCharParamCommand</param>
        /// <param name="parameter">Command parameter</param>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected void OnExecuteWithCharParamExecute(Caffeine.Core.ModelBase parent, Char parameter)
        {
        }

        /// <summary>
        /// Queries whether or not the ExecuteWithCharParamCommand can execute
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithCharParamCommand</param>
        /// <param name="parameter">Parameter to consider</param>
        /// <returns>True if the ExecuteWithCharParamCommand can execute with the parameter specified, otherwise false.</returns>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected bool OnCanExecuteWithCharParamQuery(Caffeine.Core.ModelBase parent, Char parameter)
        {
            return true;
        }

        #endregion

        #region ExecuteWithNullableIntParam Command

        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        [Caffeine.Core.ModelCommandBackingProperty("OnExecuteWithNullableIntParamExecute", "OnCanExecuteWithNullableIntParamQuery", typeof(Nullable<Int32>))]
        protected readonly Caffeine.Core.ModelCommand<Nullable<Int32>> _ExecuteWithNullableIntParamCommand = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ExecuteWithNullableIntParamCommand
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        public Caffeine.Core.ModelCommand<Nullable<Int32>> ExecuteWithNullableIntParamCommand
        {
            get { return _ExecuteWithNullableIntParamCommand; }
        }

        /// <summary>
        /// Executes the ExecuteWithNullableIntParamCommand 
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithNullableIntParamCommand</param>
        /// <param name="parameter">Command parameter</param>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected void OnExecuteWithNullableIntParamExecute(Caffeine.Core.ModelBase parent, Nullable<Int32> parameter)
        {
        }

        /// <summary>
        /// Queries whether or not the ExecuteWithNullableIntParamCommand can execute
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithNullableIntParamCommand</param>
        /// <param name="parameter">Parameter to consider</param>
        /// <returns>True if the ExecuteWithNullableIntParamCommand can execute with the parameter specified, otherwise false.</returns>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected bool OnCanExecuteWithNullableIntParamQuery(Caffeine.Core.ModelBase parent, Nullable<Int32> parameter)
        {
            return true;
        }

        #endregion

        #region ExecuteWithDoubleArrayParam Command

        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        [Caffeine.Core.ModelCommandBackingProperty("OnExecuteWithDoubleArrayParamExecute", "OnCanExecuteWithDoubleArrayParamQuery", typeof(Double[]))]
        protected readonly Caffeine.Core.ModelCommand<Double[]> _ExecuteWithDoubleArrayParamCommand = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ExecuteWithDoubleArrayParamCommand
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        public Caffeine.Core.ModelCommand<Double[]> ExecuteWithDoubleArrayParamCommand
        {
            get { return _ExecuteWithDoubleArrayParamCommand; }
        }

        /// <summary>
        /// Executes the ExecuteWithDoubleArrayParamCommand 
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithDoubleArrayParamCommand</param>
        /// <param name="parameter">Command parameter</param>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected void OnExecuteWithDoubleArrayParamExecute(Caffeine.Core.ModelBase parent, Double[] parameter)
        {
        }

        /// <summary>
        /// Queries whether or not the ExecuteWithDoubleArrayParamCommand can execute
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithDoubleArrayParamCommand</param>
        /// <param name="parameter">Parameter to consider</param>
        /// <returns>True if the ExecuteWithDoubleArrayParamCommand can execute with the parameter specified, otherwise false.</returns>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected bool OnCanExecuteWithDoubleArrayParamQuery(Caffeine.Core.ModelBase parent, Double[] parameter)
        {
            return true;
        }

        #endregion

        #region ExecuteWithChildParam Command

        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        [Caffeine.Core.ModelCommandBackingProperty("OnExecuteWithChildParamExecute", "OnCanExecuteWithChildParamQuery", typeof(ModelForMetadataTesting))]
        protected readonly Caffeine.Core.ModelCommand<ModelForMetadataTesting> _ExecuteWithChildParamCommand = null; //Will be set by reflection.

        /// <summary>
        /// Gets the ExecuteWithChildParamCommand
        /// </summary>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        public Caffeine.Core.ModelCommand<ModelForMetadataTesting> ExecuteWithChildParamCommand
        {
            get { return _ExecuteWithChildParamCommand; }
        }

        /// <summary>
        /// Executes the ExecuteWithChildParamCommand 
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithChildParamCommand</param>
        /// <param name="parameter">Command parameter</param>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected void OnExecuteWithChildParamExecute(Caffeine.Core.ModelBase parent, ModelForMetadataTesting parameter)
        {
        }

        /// <summary>
        /// Queries whether or not the ExecuteWithChildParamCommand can execute
        /// </summary>
        /// <param name="parent">Parent view model which owns the ExecuteWithChildParamCommand</param>
        /// <param name="parameter">Parameter to consider</param>
        /// <returns>True if the ExecuteWithChildParamCommand can execute with the parameter specified, otherwise false.</returns>
        [System.CodeDom.Compiler.GeneratedCode("ModelCommand Snippet", "1.0")]
        protected bool OnCanExecuteWithChildParamQuery(Caffeine.Core.ModelBase parent, ModelForMetadataTesting parameter)
        {
            return true;
        }

        #endregion

        #endregion

        #region Compare Methods

        private Boolean CompareFirstName(String original, String newValue)
        {
            return false;
        }

        private Boolean CompareCharValue(Char original, Char newValue)
        {
            return false;
        }

        #endregion

        #region Validation Methods

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Validation Snippet", "1.0")]
        private void ValidateCharValue
        (
            ModelProperty<Char> property,
            ref System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> validationErrors,
            ref bool isValid
        )
        {
            isValid = false;

            //NOTE: validationErrors is null when passed in
            System.Collections.Generic.List<Caffeine.Core.ValidationError> errors = new System.Collections.Generic.List<Caffeine.Core.ValidationError>();
            validationErrors = errors;
            errors.Add(new Caffeine.Core.ValidationError() { ErrorCode = 0, ErrorDescription = "The Error Description" });
        }

        [System.CodeDom.Compiler.GeneratedCode("ModelProperty Validation Snippet", "1.0")]
        private void ValidateFirstName
        (
            ModelProperty<String> property,
            ref System.Collections.Generic.IEnumerable<Caffeine.Core.ValidationError> validationErrors,
            ref bool isValid
        )
        {
            isValid = false;

            //NOTE: validationErrors is null when passed in
            System.Collections.Generic.List<Caffeine.Core.ValidationError> errors = new System.Collections.Generic.List<Caffeine.Core.ValidationError>();
            validationErrors = errors;
            errors.Add(new Caffeine.Core.ValidationError() { ErrorCode = 0, ErrorDescription = "The Error Description" });
        }

        #endregion

        #endregion

        #region Protected

        protected override void OnInitialized()
        {
            base.OnInitialized();
            FirstNameProperty.CompareMethod = CompareFirstName;
            FirstNameProperty.ValidationMethod = ValidateFirstName;
            CharValueProperty.CompareMethod = CompareCharValue;
            CharValueProperty.ValidationMethod = ValidateCharValue;
        }

        #endregion
    }
}
